
import axios from '~/axios'
import { joinPramas } from './manager'


// 站内信消息--------------------------

/**
 * 获取未读消息数量 
 */
export function getUnReadMsgCount() {
  return axios({
    url: "/api/backend/userMessage/getUnReadMsgCount",
    method: 'get'
  })
}

/**
 * 获取站内信列表
 * @param {*} paramIo 
 */
export function getMessageList(paramIo) {
    let finalUrl = joinPramas("/api/backend/userMessage/list", paramIo)
    return axios({
      url: finalUrl,
      method: 'get'
    })
}

/**
 * 设置已读
 * @param {*} id 
 */
export function readOne(id) { 
  return axios({
    url: "/api/backend/userMessage/read/"+id,
    method: 'post'
  })
}

/**
 * 删除消息
 * @param {*} id 
 */
export function deleteOne(id) { 
  return axios({
    url: "/api/backend/userMessage/delete/"+id,
    method: 'post'
  })
}

/**
 * 全部已读
 */
export function readAll() { 
  return axios({
    url: "/api/backend/userMessage/read/all",
    method: 'post'
  })
}

/**
 * 全部删除
 */
export function deleteAll() { 
  return axios({
    url: "/api/backend/userMessage/delete/all",
    method: 'post'
  })
}

// 站内信消息--------------------------


